package cn.ticket.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.ticket.dao.AuthuserMapper;
import cn.ticket.model.Authuser;
import cn.ticket.service.AuthUserService;
@Transactional
@Service
public class AuthUserServiceImpl implements AuthUserService {

	@Autowired
	AuthuserMapper authUserMapper;
	@Override
	public int deleteByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return authUserMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(Authuser record) {
		// TODO Auto-generated method stub
		return authUserMapper.insert(record);
	}

	@Override
	public int insertSelective(Authuser record) {
		// TODO Auto-generated method stub
		return authUserMapper.insertSelective(record);
	}

	@Override
	public Authuser selectByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return authUserMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(Authuser record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKey(Authuser record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Boolean checkUserAccess(String username, String password) {
		// TODO Auto-generated method stub
		List<Authuser> authusers=authUserMapper.selectByUsernameAndPassword(username, password);
		if (authusers.isEmpty()) {
			return false;
		}
		return true;
	}

}
